﻿<UserControl x:Class="Twilight.Views.LargeView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:Twilight.Controls"
    xmlns:v="clr-namespace:Twilight.Views"
    xmlns:vm="clr-namespace:Twilight.ViewModels"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    mc:Ignorable="d"
    d:DesignWidth="200" d:DesignHeight="400">
    <UserControl.Resources>
        <vm:ListViewModel x:Key="tweetData" d:IsDataSource="True" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="{StaticResource darkBack}" DataContext="{Binding Mode=OneWay, Source={StaticResource tweetData}}">
        <vsm:VisualStateManager.VisualStateGroups>
            <vsm:VisualStateGroup x:Name="LoadStates">
                <vsm:VisualState x:Name="Loading" />
                <vsm:VisualState x:Name="Loaded">
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="followers"
                                         Storyboard.TargetProperty="Opacity"
                                         To="1" Duration="0:0:0.25"/>
                        <DoubleAnimation Storyboard.TargetName="follow"
                                         Storyboard.TargetProperty="Opacity"
                                         To="1" Duration="0:0:0.25"/>
                        <DoubleAnimation Storyboard.TargetName="avatar"
                                         Storyboard.TargetProperty="Opacity"
                                         To="1" />
                    </Storyboard>
                </vsm:VisualState>
            </vsm:VisualStateGroup>
        </vsm:VisualStateManager.VisualStateGroups>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
            <RowDefinition Height="25" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50" />
            <ColumnDefinition Width="150"/>
        </Grid.ColumnDefinitions>
        <Border Width="48" Height="48" CornerRadius="3" BorderThickness="0" Background="#66FFFFFF">
            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="48" Text="?" />
        </Border>
        <Image x:Name="avatar" Width="48" Height="48" Stretch="None" Margin="1" Source="{Binding Avatar}" Opacity="0">
            <Image.Clip>
                <RectangleGeometry RadiusX="3" RadiusY="3" Rect="0,0,48,48" />
            </Image.Clip>
        </Image>
        <Grid Grid.Row="0" Grid.Column="1" Margin="1,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="25" />
                <RowDefinition Height="25" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Foreground="#FFFFFFFF" FontWeight="Normal" Text="{Binding Username}" FontSize="16" FontFamily="Arial" />
            <StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Top">
                <TextBlock x:Name="followers" Foreground="#44FFFFFF" Text="{Binding Followers}" FontSize="14" FontFamily="Arial" Opacity="0"/>
                <Border Opacity="0" x:Name="follow" Width="45" Margin="2,0,0,0" Height="16" BorderThickness="1" CornerRadius="3" BorderBrush="#A7FFFFFF" VerticalAlignment="Top" Background="#FF1C9B19" Cursor="Hand">
                    <HyperlinkButton x:Name="followLink" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Arial" FontSize="14" Foreground="#FFFFFFFF" Margin="0,-1,0,0" NavigateUri="{Binding FollowUri}">
                        <TextBlock Text="follow" Padding="0" Margin="0" />
                    </HyperlinkButton>
                </Border>
            </StackPanel>
        </Grid>
        <ListBox Grid.Row="1" Grid.ColumnSpan="2" ItemsSource="{Binding Path=Tweets}" ItemContainerStyle="{StaticResource FeedItemContainerStyle}" Template="{StaticResource FeedListBox}"/>
        <TextBlock x:Name="debug" Grid.Row="2" Grid.Column="0" />
        <HyperlinkButton Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="twilight" NavigateUri="http://www.codeplex.com/twilight" Foreground="#44000000" />
    </Grid>
</UserControl>
